home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 March / PCWorld_2007-03_cd.bin / komunikace / acehtml / acehtmlfreeware.exe / scriptdef / Days Old.sd < prev    next >
INI File  |  2006-09-13  |  1KB  |  56 lines

  1. [SUBJECT]
  2. Description=Calculate the number of days since a given date
  3. ImageIndex=-1
  4. Folder=Mathematics
  5.  
  6.  
  7. [BODY_TEXT]
  8. ;<script language="JavaScript">
  9. ;<!-- Begin
  10. ;var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
  11. ;function countup(yr,m,d) {
  12. ;var today=new Date();
  13. ;var todayy=today.getYear();
  14. ;
  15. ;if ((navigator.appName == "Microsoft Internet Explorer") && (todayy < 2000))
  16. ;todayy="19" + todayy;
  17. ;if (navigator.appName == "Netscape")
  18. ;todayy=1900 + todayy;
  19. ;
  20. ;var todaym=today.getMonth();
  21. ;var todayd=today.getDate();
  22. ;var todaystring=montharray[todaym]+" "+todayd+", "+todayy;
  23. ;var paststring=montharray[m-1]+" "+d+", "+yr;
  24. ;var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1);
  25. ;
  26. ;document.write("`Message_Before`" + difference + "`Message_After`");
  27. ;
  28. ;}
  29. ;countup(`Year`,`Month`,`Day`);  // Date in format:  (year,month,day)
  30. ;//  End -->
  31. ;</script>
  32. ;
  33.  
  34.  
  35. [`Year`]
  36. Kind=S
  37. Value=2000
  38.  
  39. [`Month`]
  40. Kind=S
  41. Value=03
  42.  
  43. [`Day`]
  44. Kind=S
  45. Value=10
  46.  
  47. [`Message_Before`]
  48. Kind=S
  49. Value=It was created
  50.  
  51. [`Message_After`]
  52. Kind=S
  53. Value= days ago.
  54.  
  55.  
  56.